package cn.may.utils;

import cn.may.domain.Result;

/**
 * @author mayuanbao
 * @date 2019-06-04 16:18
 */
public class ResultUtil {
    public static Result<Object> success(Object data) {
        Result<Object> result = new Result<>();
        result.setCode(0);
        result.setMsg("成功");
        result.setData(data);
        return result;
    }

    public static Result<Object> error(Integer code, String msg) {
        Result<Object> result = new Result<>();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }
}
